import '../../app_files.dart';

class SplashModel {
  String name;
  String picname;
  String url;
  String goodsID;

  SplashModel({this.name, this.picname, this.url, this.goodsID});

  SplashModel.fromJson(Map<String, dynamic> json)
      : name = json['name'],
        picname = json['picname'],
        url = json['url'],
        goodsID = CommonUtils.checkNullToString(json['goodsID']);

  Map<String, dynamic> toJson() => {
    'name': name,
    'picname': picname,
    'url': url,
    'goodsID': goodsID,
  };

  @override
  String toString() {
    StringBuffer sb = new StringBuffer('{');
    sb.write("\"name\":\"$name\"");
    sb.write(",\"picname\":\"$picname\"");
    sb.write(",\"url\":\"$url\"");
    sb.write(",\"goodsID\":\"$goodsID\"");
    sb.write('}');
    return sb.toString();
  }
}